function ComboBoxFactory() {}
ComboBoxFactory.prototype.createDistrictComboBox = function(name) {
	return new Ext.form.ComboBox({
		store : new Ext.data.JsonStore({
	                fields : ["name","id"],
	                root : "districts",
	                url : "/flats/manager/get_districts.do"
        }),	
        displayField : 'name',
        valueField : 'id',
        mode : 'local',
        emptyText :'Выберите район',	
        fieldLabel : 'Район',
        width :210,
        hiddenName : name,
        allowBlank : false
	});
};
var comboBoxFactory = new ComboBoxFactory;



function ApplicationsStoreFactory() {}	
ApplicationsStoreFactory.prototype.createApplicationStore = function(url) {
	return new Ext.data.JsonStore({
		url : url,
		fields : ["client.lastName","client.firstName","client.patronymik","createDate","id"],
		root : "applications",
		totalProperty: "count"
	});
};
var applicationsStoreFactory = new ApplicationsStoreFactory;

function ApplicationWindowsFactory() {}
ApplicationWindowsFactory.prototype.createApplicationWindow = function(title,item) {
	return new Ext.Window({
		layout : 'fit',
		title : title,
		closeAction : 'hide',	
		x : 0,
		y : 35,
		width : Ext.getBody().getViewSize().width*0.985,
		autoHeight : true,
		viewConfig : {forceFit : true},
		items : [ new Ext.Panel({border:false,
								 autoHeight : true,
							     viewConfig : {forceFit : true},
							     items :[item]}) ]
	});
};
var appWindowFactory = new ApplicationWindowsFactory;